home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / psion / amigancp.lha / AmigaNCP010b / Docs / AmigaNCP.doc next >
Text File  |  1994-10-25  |  56KB  |  1,801 lines

  1.  
  2.  
  3. AmigaNCP
  4. ********
  5.  
  6. Welcome to the AmigaNCP package, the AmigaOS implementation of
  7. Psion's NCP network protocol.
  8.  
  9. Copyright
  10. *********
  11.  
  12. This is a limited demonstration copy of the AmigaNCP package.  You
  13. may test it for up to 30 days.  If you like it, fill in the order form
  14. and send it to
  15.  
  16.      B&B Computersysteme
  17.      c/o Michael Balzer
  18.      Winchenbachstra▀e 12h
  19.      42281 Wuppertal
  20.      Germany
  21.  
  22. Payment may only be included cash or in form of a properly filled in
  23. euro cheque (with DM as currency).
  24.  
  25. In reply we will send you the full version and - if ordered - a printed
  26. manual.
  27.  
  28. The AmigaNCP package has been written by
  29.  
  30.      Oliver Wagner
  31.      o.wagner@pluribus.wupper.de
  32.      Winchenbachstra▀e 12h
  33.      42281 Wuppertal
  34.      Germany
  35.  
  36. ...who does this job for a living with his wife, four kids and two
  37. cats...
  38.  
  39. The AmigaNCP driver library, the AmigaNCP File Server, the AmigaNCP
  40. File System, the AmigaNCP Documentation and all associated files are
  41. copyright (C) 1994 Oliver Wagner, All Rights Reserved.
  42.  
  43.     Psion, the Psion Logo, Psion Series 33-LinkPsion HC,
  44. Psion MCSSD and Solid State Disk are registered Trademarks of
  45. Psion PLC.
  46.  
  47.     Amiga, the Amiga logo and AmigaDOS are registered Trademarks of
  48. Commodore-Amiga, Inc.
  49.  
  50. The author wishes to thank the following people for their help during
  51. AmigaNCP development:
  52.  
  53. David Wood of Psion Ltd.
  54.      Who provided the necessary information about the NCP protocol and
  55.      helped with beta testing the package
  56.  
  57. Jeremy "Jezar" Wakefield of Psion Ltd.
  58.      Who helped to track down several hidden and esoteric bugs.
  59.  
  60. Michael Balzer
  61.      Who crossread and corrected this manual.
  62.  
  63. Sandro Paolini
  64.      For his overall help on AmigaNCP development and testing.
  65.  
  66. Introduction
  67. ************
  68.  
  69. Overview
  70. ========
  71.  
  72. Psion's fine palmtop computer series, namely the S3 and S3a,
  73. contain an even finer operating system, whose neat features cover a full
  74. fledged peer-to-peer networking software using a protocol called
  75. NCP.
  76.  
  77. Using NCP, you can link together two Psion computers or a Psion and a
  78. different, perhaps stationary machine and happily exchange data on your
  79. behalf.  NCP services include, but are not limited to, accessing files
  80. on the remote machines as if they were on yours, in both directions.
  81.  
  82. Linking your palmtop to your stationary machine is generally quite a
  83. good idea.  Doing so via the NCP protocol requires your stationary
  84. machine to have an implemention of this protocol.  There have only been
  85. implementations for MS-DOS clones (the MCLINK.EXE shell), for Apple
  86. MacIntosh and for Acorn Archimedes - until now.
  87.  
  88. AmigaNCP features a full NCP implementation including a remote file
  89. server to access Amiga files from your Psion and a file system to access
  90. Psion files from your Amiga.  The package also offers an API to allow
  91. custom applications to directly access network services at the NCP
  92. level.
  93.  
  94. Parts of AmigaNCP
  95. =================
  96.  
  97. AmigaNCP actually consists of several different programs.
  98.  
  99. The main part is the amigancp.library.  It contains the basic network
  100. services for exchanging data between two machines via a serial
  101. connection.  The protocol provides up to 8 data channels, which can be
  102. either passive (awaiting a connection from a client process) or active
  103. (attempting to connect to a server process).  One of the channels is
  104. reserved for the network supervisor application LINK.  The LINK
  105. functionality also has been integrated into amigancp.library.
  106.  
  107. Besides network I/O functions, the library also provides several
  108. utility functions to deal with Psion text format and the Intel byte
  109. ordering.
  110.  
  111. The AmigaNCP-FileServer is an application built on top of
  112. amigancp.library.  It provides a means of accessing AmigaDOS
  113. files from the remote Psion computer via the REM:: file system.  This
  114. allows you to access Amiga files just as if they were local Psion
  115. files.  With the Psion S3a, it allows you to use the Backup option to
  116. backup vital data files on your Amiga's harddisk.
  117.  
  118. The AmigaNCP-FileSystem uses the amigancp.library to connect to
  119. the file server running on your Psion in order to provide access to
  120. Psion files from the AmigaDOS environment.  It provides a new AmigaDOS
  121. device named NCP: which offers access to all available Psion devices.
  122. The Psion devices will be mounted as subdirectories in the NCP:
  123. window.
  124.  
  125. The AmigaNCP-Monitor monitors the activity of the NCP supervisor and
  126. gives detailed statistics about all channels.  This is an invaluable
  127. aid for debugging NCP applications.
  128.  
  129. The S3PrintServer allows you to print from your S3 or S3a directly to
  130. a printer connected to the Amiga.
  131.  
  132. The S3Run program remotely launches programs or applications on your
  133. Psion.
  134.  
  135. Using AmigaNCP
  136. **************
  137.  
  138. Installation
  139. ============
  140.  
  141. For using AmigaNCP you'll need...
  142.  
  143.   1. any Amiga equipped with OS 2.04 or better and a free serial port
  144.  
  145.   2. the IBM-PC version of the 3-Link serial cable
  146.  
  147.   3. and a Psion S3 or S3a (or any other model featuring Remote
  148.      Link)(1).
  149.  
  150.  
  151. To support Amiga systems without a hard disk, the AmigaNCP distribution
  152. has been organized to be ready-to-use.
  153.  
  154. Hard disk installation of AmigaNCP is best done using the provided
  155. Installer script.  The script will (by default) copy
  156. amigancp.library to LIBS:, put the language catalogs into
  157. LOCALE:Catalogs/ and create an AmigaNCP drawer on your work
  158. partition.  The drawer will contain the network services, documentation
  159. and the NCP tools.  There's an additional option for installing the
  160. amigancp.library developer material.
  161.  
  162. When installing the package for the first time, the installation
  163. procedure will ask you about the Psion model you're going to connect
  164. to.  The serial line speed will be set to the model's maximum (that is
  165. 9600 baud for the S3 or HC and 19200 baud for S3a or MC).
  166.  
  167. Configuring amigancp.library
  168. ============================
  169.  
  170. The default serial configuration is to use the serial.device, unit 0,
  171. at 9600 baud(2).
  172.  
  173. You can overwrite these default parameters by setting or changing the
  174. environment variable NCP.config.  The environment variable will be
  175. read by the amigancp.library each time a serial connection has to be
  176. established.
  177.  
  178. The parameter parsing is done just like in a shell command line; the
  179. template is D=DEVICE/K, U=UNIT/K/N, B=BAUD/K/N, NOREQ/S.  All
  180. parameters are optional, those not given will retain their default
  181. values.
  182.  
  183. An example:  To make AmigaNCP use duart.device, unit 1 at 19200 baud
  184. you have to set ENV:NCP.config to
  185.  
  186.     DEVICE=duart.device UNIT=1 BAUD=19200
  187.  
  188. The installation script will create both ENV:NCP.config and
  189. ENVARC:NCP.config with either
  190.  
  191.     DEVICE=serial.device UNIT=0 BAUD=9600
  192.  
  193. or
  194.  
  195.     DEVICE=serial.device UNIT=0 BAUD=19200
  196.  
  197. depending on your choice of Psion model.  Please note, that you may
  198. actually use any baud rate supported by the serial port in question
  199. (and of course supported by the other side's serial interface as well).
  200.  
  201. If you set the NOREQ switch, the library will not display any error
  202. requesters.
  203.  
  204. Note that you have to configure the remote site as well.  On the Psion
  205. S3 or S3a this consists of turning on NCP via the Remote Link menu of
  206. the system screen.  The baud rate must of course be set to the same
  207. value as used in ENV:NCP.config, or to 9600 if no configuration file
  208. exists.
  209.  
  210. Starting AmigaNCP
  211. =================
  212.  
  213. You don't start amigancp.library directly.  Instead you start one or
  214. more of the AmigaNCP applications, which in turn will open the library
  215. and try to establish their connections to the remote NCP site.
  216.  
  217. The library automatically terminates a connection about 10 seconds
  218. after the last application has closed its network channels.
  219.  
  220. Note that the underlying serial device is free to be used by any other
  221. application as long as no NCP connection is active and no connection
  222. attempt is made.
  223.  
  224. NCP Requesters
  225. ==============
  226.  
  227. The amigancp.library will put up error requesters if the network link
  228. breaks (and the NOREQ switch hasn't been set, see above).  The
  229. following table shows possible error conditions:
  230.  
  231. Can't open serial device
  232.      The device specified in ENV:NCP.config could not be opened.
  233.      Either the device does not exist (perhaps just because you
  234.      misspelled the device name) or it is in use by another process.
  235.  
  236. Timeout waiting for response
  237.      The serial device opened ok but the other side is not responding
  238.      to our handshake packet.  Most likey there is no Psion connected,
  239.      or it has it's Remote Link turned off.  This requester will
  240.      constantly show up if the AmigaNCP file system is running and the
  241.      serial link broke down.
  242.  
  243. Data not acknowledged
  244.      The last data packet has not been acknowledged.  This normally
  245.      denotes an NCP connection which has been interrupted during data
  246.      transfer.
  247.  
  248. Connection dropped
  249.      The remote side dropped the connection.
  250.  
  251. Argument error
  252.      Bad LLMAC request arguments.  You normally should not see this
  253.      error, it denotes an internal failure in the amigancp.library
  254.      high level I/O functions.
  255.  
  256. Not connected
  257.      There is no LLMAC connection.  You normally should not see this
  258.      error, it denotes an internal failure in the amigancp.library
  259.      high level I/O functions.
  260.  
  261. ---------- Footnotes ----------
  262.  
  263. (1)  In fact of course any NCP implementation does.  You can use
  264. AmigaNCP to connect to an NCP server running on an IBM PC or Apple Mac,
  265. or even to another AmigaNCP running on a different Amiga.
  266.  
  267. (2)  All other serial flags are fixed to 8N1, highspeed mode and 7-wire
  268. RTS/CTS handshake since this is required by the NCP protocol.
  269.  
  270. AmigaNCP File Server
  271. ********************
  272.  
  273. Introducing the File Server
  274. ===========================
  275.  
  276. The AmigaNCP File Server is an NCP application which provides access
  277. to Amiga files from the remote machine.  On startup it creates a
  278. passive NCP channel awaiting a connection from a remote file system.
  279.  
  280. On the S3 and S3a, the remote file system is built into the ROM.  It
  281. automatically attempts to connect to the remote file server when an NCP
  282. connection is made, and presents a new filesystem node named REM::,
  283. which in turn contains all the Amiga devices.  You can navigate through
  284. the Amiga devices via the system screen or directly access a file by
  285. it's full path name.
  286.  
  287. The Psion's file system was designed to be device independant, so there
  288. are no restrictions concerning the length of file names or extensions:
  289. The complete Amiga device, directory and file names are fully
  290. preserved.  However, directories are separated in the standard Psion
  291. manner via the \ character.
  292.  
  293. An example:  To access the Amiga file HD1:Test/Test.txt from the
  294. Psion, use the file name REM::HD1:\\TEST\\TEST.TXT.  To access
  295. SYS:S/Startup-Sequence, use REM::\\SYS:\\STARTUP-SEQUENCE.
  296.  
  297. When asked for a device list, the AmigaNCP File Server will output only
  298. real file system devices(1).  However, you may in fact access any
  299. AmigaDOS device, even volumes and assigned names, from the remote site
  300. by using the direct path to it.
  301.  
  302. An example:  To access the Amiga's parallel port from the remote site,
  303. just use the path REM::PAR:\\.  This is quite useful for using the
  304. print-to-file capabilities of some of the Psion applications.
  305.  
  306. Character conversion mode
  307. =========================
  308.  
  309. Since the Psion's operating system uses a different character codeset
  310. than the Amiga does, you normally can't easily exchange ASCII files
  311. between the two machines.  The AmigaNCP File Server however provides a
  312. special conversion mode which allows to convert files on the fly.
  313.  
  314. Whenever you add the special extension .CV to any remote file name,
  315. all characters read from or written to that file will
  316. automatically be converted by AmigaNCP.  The conversion is fully
  317. transparent to your applications.
  318.  
  319. An example:  To edit the Amiga text file HD1:Test/Test.TXT on the S3
  320. with automatic character conversion, use the virtual file name
  321. REM::HD1:\\TEST\\TEST.TXT.CV.
  322.  
  323. Note that character conversion mode should be used only for text
  324. files.  The S3 and S3a Word file format for example contains binary
  325. data which will be gracefully mangled if accessed in conversion mode.
  326.  
  327. File Server Options
  328. ===================
  329.  
  330. The AmigaNCP File Server may be started either from the shell or from
  331. Workbench.  To terminate the server, just start it again, it will put
  332. up a requester showing you the number of files in use and asking you
  333. whether you really want to quit.
  334.  
  335. The File Server accepts several options to modify the way it operates.
  336. Note that you have to set up amigancp.library first (See Using
  337. AmigaNCP.).
  338.  
  339. Options may be given on the command line (shell) or using tooltype
  340. entries (Workbench).  You may use project icons to start the File
  341. Server in order to have different configurations at hand.
  342.  
  343. The option template is:
  344.          IBM=CHARSETCONV/S,
  345.      SHOWICONS=SHOWINFO/S,
  346.      HIDEEMPTYDRIVES/S,
  347.      BUFFER=BUFFERSIZE
  348. You may enter ? to get additional help at the command line.  Detailed
  349. parameter descriptions follow.
  350.  
  351. CharSetConv
  352. -----------
  353.  
  354. When the remote file system requests a directory scan, the file server
  355. examines each file to determine whether it is a text file or not(2).
  356. Text files are then returned both with their normal name and with the
  357. magic extension .CV added.
  358.  
  359. ShowInfo
  360. --------
  361.  
  362. Show *.info and .backdrop files during a directory scan.  You
  363. normally shouldn't set this option, the Psion has no use for these
  364. files and directory scans are much faster without them.
  365.  
  366. Please note that the Psion's Delete Whole Directory function will
  367. only work correctly on Amiga directories if ShowInfo has been enabled.
  368.  
  369. HideEmptyDrives
  370. ---------------
  371.  
  372. Upon a device list query, don't return drives which currently do not
  373. contain a medium.  This option is intended mainly to overcome an
  374. annoying quirk in the S3 and S3a system screen which resets the current
  375. device to LOC::\\M\\ each time a device reports E_NOT_READY.  This
  376. normally always happens when getting to REM::DF0: with no disk in the
  377. drive.
  378.  
  379. Note that, although these devices are not visible in the device list,
  380. they may as usual be accessed by manually entering the device name.
  381.  
  382. BufferSize
  383. ----------
  384.  
  385. Set the size of the filehandle buffers used by the File Server.  This
  386. parameter defaults to 4096 Bytes and normally doesn't need to be
  387. changed(3).
  388.  
  389. ---------- Footnotes ----------
  390.  
  391. (1)  Tech info:  Any device which responds positively to
  392. ACTION_IS_FILESYSTEM is considered to be a real file system.
  393.  
  394. (2)  Tech info:  This is done by reading the first 512 Bytes and
  395. scanning them for non-printable characters.  Files with the S
  396. protection bit set are always assumed to be text files.
  397.  
  398. (3)  This option has no effect on AmigaOS below version 3.1
  399.  
  400. AmigaNCP File System
  401. ********************
  402.  
  403. Introducing the File System
  404. ===========================
  405.  
  406. The AmigaNCP File System is an NCP application which provides access
  407. from the AmigaDOS environment to files on the remote machine.  It
  408. creates a new AmigaDOS device named NCP:, which in turn contains all
  409. remote devices as subdirectories.
  410.  
  411. The Amiga directory NCP:A refers to the device A: on the remote
  412. side, NCP:M refers to M: and so on.
  413.  
  414. If you want to access any file on the remote device, just add the full
  415. path name.  To access the file A:\\WRD\\SECRET.WRD, just use the
  416. Amiga file name NCP:A/WRD/SECRET.WRD.
  417.  
  418. You can access the new device from any Amiga application, including
  419. Workbench and your favourite directory tool, as if they were standard
  420. Amiga files.
  421.  
  422. On startup, the AmigaNCP File System immediately attempts to connect to
  423. the File Server on the remote machine.  If no connection can be made,
  424. the File System will refuse to start.  You may attempt to quit it at
  425. any time by starting it again, however, due to AmigaDOS constraints it
  426. will refuse to quit if there are any files or locks still in use.
  427.  
  428. Character Conversion Mode
  429. =========================
  430.  
  431. The AmigaNCP File System also features the character conversion mode.
  432. If you enable this option, all remote devices will be mirrored as
  433. CONV_<devname>, and all characters read from or written to files
  434. within these subdirectories will automatically be converted.
  435.  
  436. Example:  To access A:\\WRD\\SECRET.TXT with character conversion,
  437. use the file name NCP:CONV_A/WRD/SECRET.TXT.
  438.  
  439. The translation is fully transparent; you may, for example, use your
  440. favourite text editor to load a text file from the Psion, edit it and
  441. save it again.  Upon reading, it will be converted to the Amiga ISO
  442. character set, upon writing, it will be converted back to the IBM codes
  443. used by the Psion.
  444.  
  445. File System Options
  446. ===================
  447.  
  448. The File System accepts several options to modify the way it operates.
  449. Note that you have to set up amigancp.library first (See Using
  450. AmigaNCP.).
  451.  
  452. Upon shell startup, options are specified on the command line.  The
  453. template is:
  454.          VOL=VOLUMENAME/K,
  455.      DEV=DEVICENAME/K,
  456.      SR=SHAREDREAD/S,
  457.      IBM=CHARSETCONV/S,
  458.      HED=HIDEEMPTYDRIVES/S,
  459.      DWMS=DONTWARNMISSINGSERVER/S,
  460.      ARR=AUTOREREAD/S
  461. You may enter ? to get additional help at the command line.  See
  462. below for detailed descriptions of these parameters.
  463.  
  464. If started from Workbench, the File System application will read its
  465. icon and parse the tooltypes for the same option keywords.  You may use
  466. project icons for starting the File System in order to have different
  467. configurations at hand.
  468.  
  469. VolumeName
  470. ----------
  471.  
  472. This options allows you to set the volume node name of the File System.
  473. Defaults to AmigaNCP-Remote.  This is the name the Workbench shows
  474. below the disk icon.
  475.  
  476. DeviceName
  477. ----------
  478.  
  479. Modifies the device name of the File System.  Defaults to NCP:.
  480.  
  481. SharedRead
  482. ----------
  483.  
  484. For historical reasons, there is no real read only mode in the
  485. AmigaDOS.  The access mode MODE_OLDFILE can be used for reading and
  486. writing an existing file from multiple accessors.  So an Amiga file
  487. system cannot predict whether a file opened with MODE_OLDFILE will
  488. also be written to.
  489.  
  490. The Psion filing system however limits multiple file access to read
  491. only mode.
  492.  
  493. To be as compatible as possible with existing Amiga applications, the
  494. AmigaNCP File System by default translates MODE_OLDFILE to exclusive
  495. read/write access on the Psion.
  496.  
  497. This may cause problems if a file is already opened for reading from
  498. the Psion side, perhaps because you have a Psion application running
  499. which accesses this file.  Even a read only access from the Amiga side
  500. will fail because it translates to a read/write access on the Psion
  501. side.
  502.  
  503. In order to overcome this AmigaDOS quirk, the AmigaNCP File System
  504. provides this option to translate MODE_OLDFILE to a shared read
  505. access on the Psion side.  Every write attempt on such a file will
  506. result in a ERROR_WRITE_PROTECTED.
  507.  
  508. CharSetConv
  509. -----------
  510.  
  511. Activate character conversion mode.  All Psion devices are mirrored as
  512. CONV_<devname and read/write accesses to files within these drawers
  513. are silently translated.
  514.  
  515. Note that file handles opened in character conversion mode don't
  516. support ACTION_SEEK.  This may cause problems with some applications.
  517.  
  518. HideEmptyDrives
  519. ---------------
  520.  
  521. Don't create subdirectories for Psion devices which don't contain a
  522. medium.
  523.  
  524. DontWarnMissingServer
  525. ---------------------
  526.  
  527. The File Server should normally be started first, because the Psion
  528. LINK application attempts to contact it as soon as the connection has
  529. been established, and it will not try again if no connection could be
  530. made.
  531.  
  532. Therefore, the File System will warn you with a requester if it can't
  533. detect the AmigaNCP File Server when it is started.  Setting this option
  534. instructs the File System not to do so.
  535.  
  536. AutoReRead
  537. ----------
  538.  
  539. By default, the File System reads the remote device list only once at
  540. the time it is started.
  541.  
  542. This should normally be no problem, unless you use HideEmptyDrives
  543. and replace SSD cartridges while a connection is active.
  544.  
  545. You can use DiskChange NCP: at any time to manually force the File
  546. System to read the device list again.  Or you can set AutoReRead,
  547. which causes the File System to read the device list from the remote
  548. side upon every access, which of course will slow accesses down a bit.
  549.  
  550. Implementation Details
  551. ======================
  552.  
  553. The AmigaNCP File System supports the following AmigaDOS packet types:
  554.  
  555.    * ACTION_IS_FILESYSTEM
  556.  
  557.    * ACTION_FLUSH
  558.  
  559.    * ACTION_DISK_INFO
  560.  
  561.    * ACTION_INFO
  562.  
  563.    * ACTION_COPY_DIR
  564.  
  565.    * ACTION_COPY_DIR_FH
  566.  
  567.    * ACTION_LOCATE_OBJECT
  568.  
  569.    * ACTION_FREE_LOCK
  570.  
  571.    * ACTION_EXAMINE_FH
  572.  
  573.    * ACTION_EXAMINE_OBJECT
  574.  
  575.    * ACTION_EXAMINE_NEXT
  576.  
  577.    * ACTION_CURRENT_VOLUME
  578.  
  579.    * ACTION_SAME_LOCK
  580.  
  581.    * ACTION_CREATE_DIR
  582.  
  583.    * ACTION_PARENT
  584.  
  585.    * ACTION_PARENT_FH
  586.  
  587.    * ACTION_DELETE_OBJECT
  588.  
  589.    * ACTION_RENAME_OBJECT
  590.  
  591.    * ACTION_DIE
  592.  
  593.    * ACTION_FINDINPUT
  594.  
  595.    * ACTION_FINDOUTPUT
  596.  
  597.    * ACTION_FINDUPDATE
  598.  
  599.    * ACTION_INHIBIT
  600.  
  601.    * ACTION_END
  602.  
  603.    * ACTION_READ
  604.  
  605.    * ACTION_WRITE
  606.  
  607.    * ACTION_SEEK
  608.  
  609.    * ACTION_SET_PROTECT
  610.  
  611.    * ACTION_SET_DATE
  612.  
  613. Other Tools
  614. ***********
  615.  
  616. The AmigaNCP package contains a few more programs which are meant for
  617. the advanced user.  Since they are also good examples for how to access
  618. the amigancp.library, the source code for most of these utilities can
  619. be found in the Developer/Source/ drawer.
  620.  
  621. AmigaNCP-Monitor
  622. ================
  623.  
  624. The AmigaNCP-Monitor is a utility for monitoring the current network
  625. activity.  It displays an overview over the eight avaible NCP channels,
  626. their users, current connection states and the amount of data that has
  627. been transferred.
  628.  
  629.     AmigaNCP-Monitor may be started either from the shell or from
  630. Workbench.  There are no additional parameters.  The window position
  631. will be saved as a tooltype entry.
  632.  
  633. The Monitor opens a single window on the workbench screen.  The top
  634. part displays the states of the eight network channels, the bottom part
  635. shows overall statistics and whether NCP is currently connected.
  636.  
  637. ThisProc
  638.      The network name of the Amiga process using the channel.  The
  639.      first channel is always allocated by the LINK application.
  640.  
  641. RemotePr
  642.      The name of the remote process.  This may be empty, meaning the
  643.      channel is currently not connected.
  644.  
  645.          UnknClnt identifies a passive channel connected to an
  646.      unknown client.
  647.  
  648.      For the first channel, this may be either ARemLink, denoting
  649.      that the current connection has been initiated by the remote link,
  650.      or PRemLink, if the current connection was opened on behalf of
  651.      the amigancp.library.
  652.  
  653. Status
  654.      This flag array denotes various internal states of
  655.      amigancp.library.
  656.  
  657. Bytes Sent
  658.      How many bytes have been sent through this channel?
  659.  
  660. Bytes Received
  661.      How many bytes have been received through this channel?
  662.  
  663. Online since
  664.      The time on which amigancp.library was started first.  The
  665.      startup time is used by the NCP protocol to determine whether a
  666.      broken connection can be reestablished or not.
  667.  
  668. Remote NCP
  669.      The remote NCP's startup time.
  670.  
  671. Version
  672.      The remote NCP's version.  This is generally 2 for AmigaNCP and
  673.      the Psion S3 and 3 for the S3a.
  674.  
  675. Connected
  676.      This will be displayed whenever there is an active connection to
  677.      any remote NCP.
  678.  
  679. S3PrintServer
  680. =============
  681.  
  682. The S3PrintServer is a small utility which allows you to print from
  683. your Psion directly to a printer connected to the Amiga.  It uses the
  684. Psion's capability to print to a serial printer, and simply passes any
  685. data from the serial port directly to the printer device via raw writes.
  686.  
  687. You have to turn off the Remote Link on the Psion side and terminate
  688. any NCP application running on the Amiga side before starting the
  689. S3PrintServer.  If you forget to turn off the Remote Link, junk will
  690. be printed due to misinterpreted NCP packets!
  691.  
  692. You must also set your Psion's printer configuration to serial
  693. printing, with the same baud rate used for NCP connections, turn off
  694. Xon/Xoff and turn on RTS/CTS and DSR/DTR handshaking.  The
  695. S3PrintServer itself reads the serial configuration from the file
  696. ENV:NCP.config.
  697.  
  698. The S3PrintServer uses the raw write capabilities of the
  699. printer.device and therefore ignores any printer driver settings.
  700. However, it respects your choice on which device to print, and even
  701. allows printing via network printer services, e.g.  Envoy Network
  702. Printing.
  703.  
  704. Therefore, you must select the correct WDR printer driver on the
  705. Psion.  This can be done in the Printer Setup dialog of the
  706. Word application.
  707.  
  708. Having done all this, you can print from your Psion applications simply
  709. by selecting the Print... menu, just as if the printer was connected
  710. directly to the Psion.
  711.  
  712. S3Run
  713. =====
  714.  
  715. The S3Run utility uses the LINK application's capability to launch
  716. a process on the remote side.  It's a shell only program which takes
  717. one or two parameters: S3Run filename commandline
  718.  
  719. The first argument denotes the file name of the remote program to run,
  720. for example TEST.IMG.  Due to NCP restrictions, this may only be a
  721. program on the Psion's top level directory or ROM.
  722.  
  723. The second argument may contain the command line to be passed to the
  724. created process.  This argument may be omitted, in which case no command
  725. line will be passed.
  726.  
  727. You may use \\xx escaping to insert the hexadecimal code xx into
  728. the command line.  See `the Psion SIBO SDK Manual' for more information
  729. on S3 command lines.
  730.  
  731. API
  732. ***
  733.  
  734. This part of the AmigaNCP documentation describes the use of AmigaNCP
  735. services within custom applications.  It assumes a broad knowledge of
  736. programming AmigaOS.
  737.  
  738. NCP Implementation
  739. ==================
  740.  
  741. The Psion NCP network protocol consists of four layers:
  742.  
  743. Serial Layer
  744.      A simple asynchronous serial 8/N/1 connection.  This is in fact
  745.      the hardware serial connection built into the 3-Link.
  746.  
  747. Packet Layer
  748.      A packet protocol providing checksums and multiple
  749.      retransmissions.  It is called LLMAC and somewhat based on the
  750.      MNP type protocols.
  751.  
  752. NCP Layer
  753.      NCP provides up to eight independant data streams between local
  754.      and remote processes.  Under the Psion OS, a process may use only
  755.      one NCP channel at a time.
  756.  
  757. Application Layer
  758.      Applications built on top of the NCP data stream service.  This
  759.      includes the remote file system and remote file server.  There is
  760.      also a supervisory application called LINK which controls the
  761.      server setup.
  762.  
  763. A more detailed description of NCP usage from the Psion side can be
  764. found in the `Psion SIBO SDK Manual, I/O Devices Reference'.
  765.  
  766. On the Amiga side, the serial layer is provided through any standard
  767. EXEC serial device, normally this will be the internal port's
  768. serial.device.  The packet and NCP layers have been built into
  769. the amigancp.library.
  770.  
  771. Besides these basic layers, also the supervisory LINK application
  772. resides in the
  773.     amigancp.library.
  774.  
  775. All network services are accessible via function calls to the
  776. amigancp.library.  In order to use these functions, you have to
  777. open the amigancp.library first:
  778.  
  779.          #include <libraries/ncp.h>
  780.      
  781.          struct Library *NCPBase;
  782.          NCPBase = OpenLibrary( "amigancp.library", NCP_VERSION );
  783.          if( !NCPBase )
  784.              fail_app();
  785.  
  786. If you use SAS/C 6.50 or above, you may want to use the link library
  787. ncp.lib provided in the development toolkit.  It contains a
  788. constructor/destructor pair that automatically opens/closes the
  789. amigancp.library upon startup/termination of your application.
  790.  
  791. If you are not using C, you'll have to build your own language specific
  792. glue definitions.  A function description file
  793. (Developer/FD/ncp_lib.fd) has been included.  The AmigaNCP
  794. programming interface doesn't use any fancy data structures, so you
  795. should have no problems with other programming languages.
  796.  
  797. The NCP network services are based on channels.  A channel is a
  798. connection between a local and a remote processes.  In the Psion EPOC
  799. environment, a channel is bound to a single process and bears the name
  800. of that process.  AmigaNCP allows you to specify arbitrary names for
  801. your channels, along with having multiple channels within a single
  802. application, if you wish to do so.
  803.  
  804. A channel may be opened in either active or passive mode.  An
  805. active channel attempts to connect to a remote process with a given name
  806. and refuses to open if the remote process doesn't exists or already is
  807. busy with some other connection.  A passive channel just sits around
  808. awaiting a connection from the remote site.  Passive channels are
  809. normally used for server applications awaiting connections from their
  810. clients, whereas active channels are used by clients to contact their
  811. server application.
  812.  
  813. I/O via NCP is done either synchronously or asynchronously.  The
  814. I/O interface of the amigancp.library is quite similar to the EXEC
  815. device I/O interface.  See the function descriptions of the NCP I/O
  816. functions for more details.
  817.  
  818. The Developer/Source/ drawer provides some examples to show the use
  819. of the
  820.     amigancp.library calls.
  821.  
  822. Function Reference
  823. ==================
  824.  
  825. Note that this function reference is also available in standard Amiga
  826. Autodoc format (Developer/Autodocs/ncp.doc).
  827.  
  828. NCP_CloseChannel
  829. ----------------
  830.  
  831.         NAME
  832.          NCP_CloseChannel -- close an NCP channel
  833.      
  834.         SYNOPSIS
  835.          NCP_CloseChannel( channel )
  836.                             A0
  837.      
  838.         void NCP_CloseChannel( APTR );
  839.      
  840.         FUNCTION
  841.          Close a NCP channel previously opened by NCP_OpenChannel().
  842.          If this is an active link to the remote machine, it will be
  843.          closed.
  844.      
  845.         INPUTS
  846.          channel -- channel to close. May be NULL, in which case
  847.                     this functions does nothing.
  848.      
  849.         RESULT
  850.          None.
  851.      
  852.         EXAMPLE
  853.      
  854.         NOTES
  855.          An active NCP connection will be dropped about 10s
  856.          after the last channel has been closed.
  857.      
  858.         BUGS
  859.          None known.
  860.      
  861.         SEE ALSO
  862.          NCP_OpenChannel()
  863.  
  864. NCP_OpenChannel
  865. ---------------
  866.  
  867.         NAME
  868.          NCP_OpenChannel -- open an NCP channel to attempt to connect to
  869.                            the remote.
  870.      
  871.         SYNOPSIS
  872.          channel = NCP_OpenChannel( localname, remotename, flags )
  873.            D0                          A0          A1        D0
  874.      
  875.          APTR NCP_OpenChannel( STRPTR, STRPTR, ULONG );
  876.      
  877.         FUNCTION
  878.          Opens an NCP channel. If remotename is not NULL, attempts
  879.          to connect to the remote process and fails with a NULL
  880.          return if the connection could not be made. If remotename
  881.          is NULL, creates a passive channel silently awaiting remote
  882.          connection.
  883.      
  884.         INPUTS
  885.          localname -- name of local "process"
  886.          remotename -- either NULL for a passive channel or
  887.                        the remote process name which to connect
  888.                        to
  889.          flags -- currently unused, leave at 0
  890.      
  891.         RESULT
  892.          channel -- pointer to a channel object. NULL in case of
  893.                     an error, whereas additional error information
  894.                     can be found in IoErr()
  895.      
  896.         EXAMPLE
  897.          To connect to the remote file server:
  898.      
  899.             APTR channel;
  900.             channel = NCP_OpenChannel( "TestHost", "SYS$RFSV.*", 0 );
  901.      
  902.      
  903.         NOTES
  904.          Opening an active channel will result in an attempt to
  905.          create an NCP connection and fail upon any error (including
  906.          serial failure or inexistance of the remote process).
  907.          Creating an passive channel will not cause an NCP connection
  908.          attempt; this is done upon the first I/O request made to
  909.          channel.
  910.      
  911.         BUGS
  912.          None known.
  913.      
  914.         SEE ALSO
  915.          NCP_CloseChannel()
  916.  
  917. NCP_Read
  918. --------
  919.  
  920.         NAME
  921.          NCP_Read -- do a read request.
  922.      
  923.         SYNOPSIS
  924.          status = NCP_Read( channel, data, datasize )
  925.            D0                     A0
  926.      
  927.          LONG NCP_Read( APTR, APTR, ULONG );
  928.      
  929.         FUNCTION
  930.          This is basically identical to calling NCP_BeginRead()
  931.          followed by NCP_WaitRead().
  932.      
  933.         INPUTS
  934.          channel -- a NCP channel created by NCP_OpenChannel()
  935.          data -- receive buffer
  936.          datasize -- receive buffer size
  937.      
  938.         RESULT
  939.          status -- number of bytes read or a negative error
  940.                    number.
  941.      
  942.         EXAMPLE
  943.      
  944.         NOTES
  945.      
  946.         BUGS
  947.      
  948.         SEE ALSO
  949.          NCP_WaitRead(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  950.  
  951. NCP_BeginRead
  952. -------------
  953.  
  954.         NAME
  955.          NCP_BeginRead -- start a read request on the NCP channel.
  956.      
  957.         SYNOPSIS
  958.          error = NCP_BeginRead( channel, data, datasize )
  959.            D0                     A0      A1       D0
  960.      
  961.          LONG NCP_BeginRead( APTR, APTR, ULON G);
  962.      
  963.         FUNCTION
  964.          Queues a read operation on the current NCP channel.
  965.      
  966.         INPUTS
  967.          channel -- a NCP channel created by NCP_OpenChannel()
  968.          data -- receive buffer
  969.          datasize -- receive buffer size
  970.      
  971.         RESULT
  972.          error -- either 0 if the read was queued successfully
  973.                   or a negative error number
  974.      
  975.         EXAMPLE
  976.      
  977.         NOTES
  978.          Only one read request may be queued at a time on a single
  979.          channel. This function fails with NCPE_INUSE if there is
  980.          already a read request outstanding.
  981.      
  982.         BUGS
  983.          None known.
  984.      
  985.         SEE ALSO
  986.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_CheckRead()
  987.  
  988. NCP_AbortRead
  989. -------------
  990.  
  991.         NAME
  992.          NCP_AbortRead -- abort read currently in progress
  993.      
  994.         SYNOPSIS
  995.          NCP_AbortRead( channel )
  996.                           A0
  997.      
  998.          void NCP_AbortRead( APTR )
  999.      
  1000.         FUNCTION
  1001.          Aborts the current read request on the given NCP channel.
  1002.          Does nothing if no read is pending.
  1003.      
  1004.         INPUTS
  1005.          channel -- a NCP channel created by NCP_OpenChannel()
  1006.      
  1007.         RESULT
  1008.          None.
  1009.      
  1010.         EXAMPLE
  1011.      
  1012.         NOTES
  1013.          Never forget to finish a read request using NCP_WaitRead(),
  1014.          or you'll end up in OS hell.
  1015.      
  1016.         BUGS
  1017.          None known.
  1018.      
  1019.         SEE ALSO
  1020.          NCP_Read(), NCP_WaitRead(), NCP_CheckRead(), NCP_BeginRead()
  1021.  
  1022. NCP_CheckRead
  1023. -------------
  1024.  
  1025.         NAME
  1026.          NCP_CheckRead -- check if a read request is still pending
  1027.      
  1028.         SYNOPSIS
  1029.          status = NCP_CheckRead( channel )
  1030.            D0                       A0
  1031.      
  1032.          LONG NCP_CheckRead( APTR )
  1033.      
  1034.         FUNCTION
  1035.          Check if a read request is still pending on the given NCP
  1036.          channel.
  1037.      
  1038.         INPUTS
  1039.          channel -- a NCP channel created by NCP_OpenChannel()
  1040.      
  1041.         RESULT
  1042.          status -- FALSE if a read is currently pending,
  1043.                    TRUE if no request is pending or the current
  1044.                    request has completed.
  1045.      
  1046.         EXAMPLE
  1047.      
  1048.         NOTES
  1049.          Never forget to finish a read request using NCP_WaitRead(),
  1050.          or you'll end up in OS hell.
  1051.      
  1052.         BUGS
  1053.          None known.
  1054.      
  1055.         SEE ALSO
  1056.          NCP_Read(), NCP_WaitRead(), NCP_AbortRead(), NCP_BeginRead()
  1057.  
  1058. NCP_WaitRead
  1059. ------------
  1060.  
  1061.         NAME
  1062.          NCP_WaitRead -- complete a read request on the NCP channel.
  1063.      
  1064.         SYNOPSIS
  1065.          result = NCP_WaitRead( channel )
  1066.            D0                     A0
  1067.      
  1068.          LONG NCP_WaitRead( APTR );
  1069.      
  1070.         FUNCTION
  1071.          Waits for the current read request to finish and
  1072.          returns the result.
  1073.      
  1074.         INPUTS
  1075.          channel -- a NCP channel created by NCP_OpenChannel()
  1076.      
  1077.         RESULT
  1078.          status -- number of bytes read or a negative error
  1079.                    number.
  1080.      
  1081.         EXAMPLE
  1082.      
  1083.         NOTES
  1084.          Every read request startet with NCP_BeginRead() absolutely
  1085.          must be followed by a NCP_WaitRead(), even if it already
  1086.          finished or was aborted via NCP_AbortRead().
  1087.      
  1088.         BUGS
  1089.          Calling this function without an queued read request
  1090.          will hang up your process.
  1091.      
  1092.         SEE ALSO
  1093.          NCP_Read(), NCP_BeginRead(), NCP_AbortRead(), NCP_CheckRead()
  1094.  
  1095. NCP_ReadSig
  1096. -----------
  1097.  
  1098.         NAME
  1099.          NCP_ReadSig -- return signal mask of channel read port.
  1100.      
  1101.         SYNOPSIS
  1102.          sigmask = NCP_ReadSig( channel )
  1103.            D0                     A0
  1104.      
  1105.          ULONG NCP_ReadSig( APTR );
  1106.      
  1107.         FUNCTION
  1108.          This function returns the signal mask of the read port
  1109.          of the given NCP channel. This signal is set if a read
  1110.          request completes.
  1111.      
  1112.         INPUTS
  1113.          channel -- a NCP channel created by NCP_OpenChannel()
  1114.      
  1115.         RESULT
  1116.          sigmask -- signal mask of read port.
  1117.      
  1118.         EXAMPLE
  1119.      
  1120.         NOTES
  1121.          Note that this function returns a signal mask, not a signal bit number.
  1122.      
  1123.         BUGS
  1124.      
  1125.         SEE ALSO
  1126.          NCP_BeginRead()
  1127.  
  1128. NCP_Write
  1129. ---------
  1130.  
  1131.         NAME
  1132.          NCP_Write -- do a write request.
  1133.      
  1134.         SYNOPSIS
  1135.          status = NCP_Write( channel, data, datasize )
  1136.            D0                   A0     A1      D0
  1137.      
  1138.          LONG NCP_Write( APTR, APTR, ULONG );
  1139.      
  1140.         FUNCTION
  1141.          This is basically identical to calling NCP_BeginWrite()
  1142.          followed by NCP_WaitWrite().
  1143.      
  1144.         INPUTS
  1145.          channel -- a NCP channel created by NCP_OpenChannel()
  1146.          data -- receive buffer
  1147.          datasize -- receive buffer size
  1148.      
  1149.         RESULT
  1150.          status -- number of bytes written or a negative error
  1151.                    number.
  1152.      
  1153.         EXAMPLE
  1154.      
  1155.         NOTES
  1156.      
  1157.         BUGS
  1158.      
  1159.         SEE ALSO
  1160.          NCP_WaitWrite(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1161.  
  1162. NCP_BeginWrite
  1163. --------------
  1164.  
  1165.         NAME
  1166.          NCP_BeginWrite -- start a write request on the NCP channel.
  1167.      
  1168.         SYNOPSIS
  1169.          error = NCP_BeginWrite( channel, data, datasize )
  1170.            D0                     A0      A1       D0
  1171.      
  1172.          LONG NCP_BeginWrite( APTR, APTR, ULON G);
  1173.      
  1174.         FUNCTION
  1175.          Queues a write operation on the current NCP channel.
  1176.      
  1177.         INPUTS
  1178.          channel -- a NCP channel created by NCP_OpenChannel()
  1179.          data -- data buffer
  1180.          datasize -- data buffer size
  1181.      
  1182.         RESULT
  1183.          error -- either 0 if the write was queued successfully
  1184.                   or a negative error number
  1185.      
  1186.         EXAMPLE
  1187.      
  1188.         NOTES
  1189.          Only one write request may be queued at a time on a single
  1190.          channel. This function fails with NCPE_INUSE if there is
  1191.          already a write request outstanding.
  1192.      
  1193.         BUGS
  1194.          None known.
  1195.      
  1196.         SEE ALSO
  1197.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1198.  
  1199. NCP_AbortWrite
  1200. --------------
  1201.  
  1202.         NAME
  1203.          NCP_AbortWrite -- abort write currently in progress
  1204.      
  1205.         SYNOPSIS
  1206.          NCP_AbortWrite( channel )
  1207.                           A0
  1208.      
  1209.          void NCP_AbortWrite( APTR )
  1210.      
  1211.         FUNCTION
  1212.          Aborts the current write request on the given NCP channel.
  1213.          Does nothing if no write is pending.
  1214.      
  1215.         INPUTS
  1216.          channel -- a NCP channel created by NCP_OpenChannel()
  1217.      
  1218.         RESULT
  1219.          None.
  1220.      
  1221.         EXAMPLE
  1222.      
  1223.         NOTES
  1224.          Never forget to finish a write request using NCP_WaitWrite(),
  1225.          or you'll end up in OS hell.
  1226.      
  1227.         BUGS
  1228.          None known.
  1229.      
  1230.         SEE ALSO
  1231.          NCP_Write(), NCP_WaitWrite(), NCP_CheckWrite(), NCP_BeginWrite()
  1232.  
  1233. NCP_CheckWrite
  1234. --------------
  1235.  
  1236.         NAME
  1237.          NCP_CheckWrite -- check if a write request is still pending
  1238.      
  1239.         SYNOPSIS
  1240.          status = NCP_CheckWrite( channel )
  1241.            D0                       A0
  1242.      
  1243.          LONG NCP_CheckWrite( APTR )
  1244.      
  1245.         FUNCTION
  1246.          Check if a write request is still pending on the given NCP
  1247.          channel.
  1248.      
  1249.         INPUTS
  1250.          channel -- a NCP channel created by NCP_OpenChannel()
  1251.      
  1252.         RESULT
  1253.          status -- FALSE if a write is currently pending,
  1254.                    TRUE if no request is pending or the current
  1255.                    request has completed.
  1256.      
  1257.         EXAMPLE
  1258.      
  1259.         NOTES
  1260.          Never forget to finish a write request using NCP_WaitWrite(),
  1261.          or you'll end up in OS hell.
  1262.      
  1263.         BUGS
  1264.          None known.
  1265.      
  1266.         SEE ALSO
  1267.          NCP_Write(), NCP_WaitWrite(), NCP_AbortWrite(), NCP_BeginWrite()
  1268.  
  1269. NCP_WaitWrite
  1270. -------------
  1271.  
  1272.         NAME
  1273.          NCP_WaitWrite -- complete a write request on the NCP channel.
  1274.      
  1275.         SYNOPSIS
  1276.          result = NCP_WaitWrite( channel )
  1277.            D0                     A0
  1278.      
  1279.          LONG NCP_WaitWrite( APTR );
  1280.      
  1281.         FUNCTION
  1282.          Waits for the current write request to finish and
  1283.          returns the result.
  1284.      
  1285.         INPUTS
  1286.          channel -- a NCP channel created by NCP_OpenChannel()
  1287.      
  1288.         RESULT
  1289.          status -- number of bytes written or a negative error
  1290.                    number.
  1291.      
  1292.         EXAMPLE
  1293.      
  1294.         NOTES
  1295.          Every write request startet with NCP_BeginWrite() absolutely
  1296.          must be followed by a NCP_WaitWrite(), even if it already
  1297.          finished or was aborted via NCP_AbortWrite().
  1298.      
  1299.         BUGS
  1300.          Calling this function without an queued write request
  1301.          will hang up your process.
  1302.      
  1303.         SEE ALSO
  1304.          NCP_Write(), NCP_BeginWrite(), NCP_AbortWrite(), NCP_CheckWrite()
  1305.  
  1306. NCP_WriteSig
  1307. ------------
  1308.  
  1309.         NAME
  1310.          NCP_WriteSig -- return signal mask of channel write port.
  1311.      
  1312.         SYNOPSIS
  1313.          sigmask = NCP_WriteSig( channel )
  1314.            D0                     A0
  1315.      
  1316.          ULONG NCP_WriteSig( APTR );
  1317.      
  1318.         FUNCTION
  1319.          This function returns the signal mask of the write port
  1320.          of the given NCP channel. This signal is set if a write
  1321.          request completes.
  1322.      
  1323.         INPUTS
  1324.          channel -- a NCP channel created by NCP_OpenChannel()
  1325.      
  1326.         RESULT
  1327.          sigmask -- signal mask of write port.
  1328.      
  1329.         EXAMPLE
  1330.      
  1331.         NOTES
  1332.          Note that this function returns a signal mask, not a signal bit number.
  1333.      
  1334.         BUGS
  1335.      
  1336.         SEE ALSO
  1337.          NCP_BeginWrite()
  1338.  
  1339. NCP_Fault
  1340. ---------
  1341.  
  1342.         NAME
  1343.          NCP_Fault -- return localized NCP error string
  1344.      
  1345.         SYNOPSIS
  1346.          NCP_Fault( code, header, buffer, buffersize );
  1347.                     D0     A0      A1        D1
  1348.      
  1349.         void NCP_Fault( LONG, STRPTR, STRPTR, ULONG );
  1350.      
  1351.         FUNCTION
  1352.          Returns a localized text string associated with the
  1353.          error code.
  1354.      
  1355.         INPUTS
  1356.          code -- NCP error code
  1357.          header -- header to insert before string. May be NULL
  1358.          buffer -- buffer to write the error text to
  1359.          buffersize -- size of buffer
  1360.      
  1361.         RESULT
  1362.          None.
  1363.      
  1364.         EXAMPLE
  1365.      
  1366.         NOTES
  1367.      
  1368.         BUGS
  1369.          None known.
  1370.      
  1371.         SEE ALSO
  1372.          dos.library/Fault()
  1373.  
  1374. NCP_LinkRemoteRun
  1375. -----------------
  1376.  
  1377.         NAME
  1378.          NCP_LinkRemoteRun -- use the NCP link channel to run a program on
  1379.                               the remote machine.
  1380.      
  1381.         SYNOPSIS
  1382.          error = NCP_LinkRemoteRun( filename, cmdline, cmdlinelen )
  1383.          D0                            A0       A1        D0
  1384.      
  1385.         LONG NCP_LinkRemoteRun( STRPTR, APTR, ULONG );
  1386.      
  1387.         FUNCTION
  1388.          Use the LINK supervisor channel to have the remote link
  1389.          run a program. No NCP channel needs to be opened in order
  1390.          to perform this operation.
  1391.      
  1392.         INPUTS
  1393.          filename -- file name of the remote program to start
  1394.          cmdline -- pointer to command line array. Note that
  1395.                     EPOC command lines are *NOT* zero terminated.
  1396.          cmdlinelen -- length of command line in bytes. May be
  1397.                        zero, in which case no command line
  1398.                        is transfered.
  1399.      
  1400.         RESULT
  1401.          error -- either an AmigaNCP specific error code or the
  1402.                   result code from the remote link.
  1403.      
  1404.         EXAMPLE
  1405.          Have WORD.APP read the Amiga startup sequence:
  1406.      
  1407.             UBYTE cmdline[] = {
  1408.              "OANCPTest\000 V TES\000REM::SYS:\S\STARTUP-SEQUENCE\000"
  1409.             };
  1410.             error = NCP_LinkRemoteRun( "WORD.APP", cmdline, sizeof( cmdline ) );
  1411.      
  1412.         NOTES
  1413.          See the Psion SDK for more information about using commandlines and
  1414.          the LINK process launch feature.
  1415.      
  1416.         BUGS
  1417.          None known.
  1418.      
  1419.         SEE ALSO
  1420.  
  1421. NCP_clnl
  1422. --------
  1423.  
  1424.         NAME
  1425.          NCP_clnl -- clear CR/LF at end of line.
  1426.      
  1427.         SYNOPSIS
  1428.          NCP_clnl( string )
  1429.                    A0
  1430.      
  1431.          void NCP_clnl( STRPTR );
  1432.      
  1433.         FUNCTION
  1434.          Clears any CR or LF characters at the end of the string.
  1435.      
  1436.         INPUTS
  1437.          string -- pointer to string (contents will be modified)
  1438.      
  1439.         RESULT
  1440.          None.
  1441.      
  1442.         EXAMPLE
  1443.      
  1444.         NOTES
  1445.      
  1446.         BUGS
  1447.          None known.
  1448.      
  1449.         SEE ALSO
  1450.  
  1451. NCP_ibm2iso
  1452. -----------
  1453.  
  1454.         NAME
  1455.          NCP_ibm2iso -- convert IBM to ISO charachter
  1456.      
  1457.         SYNOPSIS
  1458.          isochar = NCP_ibm2iso( ibmchar )
  1459.            D0                    D0 0:7
  1460.      
  1461.          UBYTE NCP_ibm2iso( UBYTE );
  1462.      
  1463.         FUNCTION
  1464.          Converts a character from the IBM to the ISO charset.
  1465.      
  1466.         INPUTS
  1467.          ibmchar -- character of the IBM codeset
  1468.      
  1469.         RESULT
  1470.          isochar -- equivalent character in the ISO codeset
  1471.      
  1472.         EXAMPLE
  1473.      
  1474.         NOTES
  1475.      
  1476.         BUGS
  1477.          None known.
  1478.      
  1479.         SEE ALSO
  1480.  
  1481. NCP_iso2ibm
  1482. -----------
  1483.  
  1484.         NAME
  1485.          NCP_iso2ibm -- convert IBM to ISO charachter
  1486.      
  1487.         SYNOPSIS
  1488.          ibmchar = NCP_iso2ibm( isochar )
  1489.            D0                    D0 0:7
  1490.      
  1491.          UBYTE NCP_iso2ibm( UBYTE );
  1492.      
  1493.         FUNCTION
  1494.          Converts a character from the ISO to the IBM charset.
  1495.      
  1496.         INPUTS
  1497.          isochar -- character of the ISO codeset
  1498.      
  1499.         RESULT
  1500.          ibmchar -- equivalent character in the IBM codeset
  1501.      
  1502.         EXAMPLE
  1503.      
  1504.         NOTES
  1505.      
  1506.         BUGS
  1507.          None known.
  1508.      
  1509.         SEE ALSO
  1510.  
  1511. NCP_IWORD
  1512. ---------
  1513.  
  1514.         NAME
  1515.          NCP_IWORD -- swap bytes in word
  1516.      
  1517.         SYNOPSIS
  1518.          sword = NCP_IWORD( word )
  1519.            D0                D0
  1520.      
  1521.          UWORD NCP_IWORD( UWORD );
  1522.      
  1523.         FUNCTION
  1524.          Swaps the byte order within the word.
  1525.      
  1526.         INPUTS
  1527.          word -- a 16 bit data word.
  1528.      
  1529.         RESULT
  1530.          sword -- the same word with the byte order swapped.
  1531.      
  1532.         EXAMPLE
  1533.      
  1534.         NOTES
  1535.      
  1536.         BUGS
  1537.          None known.
  1538.      
  1539.         SEE ALSO
  1540.  
  1541. NCP_IWORDP
  1542. ----------
  1543.  
  1544.         NAME
  1545.          NCP_IWORDP -- swap bytes in word (pointer version)
  1546.      
  1547.         SYNOPSIS
  1548.          sword = NCP_IWORDP( wordp1, wordp2 )
  1549.            D0                  A0      A1
  1550.      
  1551.          UWORD NCP_IWORDP( UWORD *, UWORD * );
  1552.      
  1553.         FUNCTION
  1554.          Swaps the byte order from the word pointed to by wordp1
  1555.          and places the result in the word pointed to by wordp2.
  1556.      
  1557.         INPUTS
  1558.          wordp1 -- pointer to source word
  1559.          wordp2 -- pointer to destination word
  1560.      
  1561.         RESULT
  1562.          sword -- the same word with the byte order swapped.
  1563.      
  1564.         EXAMPLE
  1565.      
  1566.         NOTES
  1567.          The words don't need to be word aligned.
  1568.      
  1569.         BUGS
  1570.          The 68020++ version of amigancp.library requires the hardware
  1571.          to be able to do misaligned word accesses. Some early
  1572.          accelerator boards may have problems doing this.
  1573.      
  1574.         SEE ALSO
  1575.  
  1576. NCP_IWORDPI
  1577. -----------
  1578.  
  1579.         NAME
  1580.          NCP_IWORDPI -- swap bytes in word (in-place pointer version)
  1581.      
  1582.         SYNOPSIS
  1583.          sword = NCP_IWORDPI( wordp1 )
  1584.            D0                   A0
  1585.      
  1586.          UWORD NCP_IWORDP( UWORD * )
  1587.      
  1588.         FUNCTION
  1589.          Swaps the byte order within the word pointed to by wordp.
  1590.      
  1591.         INPUTS
  1592.          wordp -- pointer to word to swap
  1593.      
  1594.         RESULT
  1595.          sword -- the same word with the byte order swapped.
  1596.      
  1597.         EXAMPLE
  1598.      
  1599.         NOTES
  1600.          The word doesn't need to be word aligned.
  1601.      
  1602.         BUGS
  1603.          The 68020++ version of amigancp.library requires the hardware
  1604.          to be able to do misaligned word accesses. Some early
  1605.          accelerator boards may have problems doing this.
  1606.      
  1607.         SEE ALSO
  1608.  
  1609. NCP_ILONG
  1610. ---------
  1611.  
  1612.         NAME
  1613.          NCP_ILONG -- swap bytes in longword
  1614.      
  1615.         SYNOPSIS
  1616.          slongword = NCP_ILONG( longword )
  1617.            D0                     D0
  1618.      
  1619.          ULONG NCP_ILONG( ULONG );
  1620.      
  1621.         FUNCTION
  1622.          Swaps the byte order within the longword.
  1623.      
  1624.         INPUTS
  1625.          longword -- a 32 bit data word.
  1626.      
  1627.         RESULT
  1628.          slongword -- the same word with the byte order swapped.
  1629.      
  1630.         EXAMPLE
  1631.      
  1632.         NOTES
  1633.      
  1634.         BUGS
  1635.          None known.
  1636.      
  1637.         SEE ALSO
  1638.  
  1639. NCP_ILONGP
  1640. ----------
  1641.  
  1642.         NAME
  1643.          NCP_ILONGP -- swap bytes in longword (pointer version)
  1644.      
  1645.         SYNOPSIS
  1646.          sword = NCP_ILONGP( longwordp1, longwordp2 )
  1647.            D0                    A0          A1
  1648.      
  1649.          ULONG NCP_ILONGP( ULONG *, ULONG * );
  1650.      
  1651.         FUNCTION
  1652.          Swaps the byte order from the longword pointed to by longwordp1
  1653.          and places the result in the longword pointed to by longwordp2.
  1654.      
  1655.         INPUTS
  1656.          longwordp1 -- pointer to source longword
  1657.          longwordp2 -- pointer to destination longword
  1658.      
  1659.         RESULT
  1660.          sword -- the same word with the byte order swapped.
  1661.      
  1662.         EXAMPLE
  1663.      
  1664.         NOTES
  1665.          The longwords don't need to be word aligned.
  1666.      
  1667.         BUGS
  1668.          The 68020++ version of amigancp.library requires the hardware
  1669.          to be able to do misaligned word accesses. Some early
  1670.          accelerator boards may have problems doing this.
  1671.      
  1672.         SEE ALSO
  1673.  
  1674. NCP_ILONGPI
  1675. -----------
  1676.  
  1677.         NAME
  1678.          NCP_ILONGPI -- swap bytes in longword (in-place pointer version)
  1679.      
  1680.         SYNOPSIS
  1681.          sword = NCP_ILONGPI( longwordp )
  1682.            D0                    A0
  1683.      
  1684.          ULONG NCP_ILONGP( ULONG * )
  1685.      
  1686.         FUNCTION
  1687.          Swaps the byte order within the longword pointed to by longwordp.
  1688.      
  1689.         INPUTS
  1690.          longwordp -- pointer to longword to swap
  1691.      
  1692.         RESULT
  1693.          sword -- the same word with the byte order swapped.
  1694.      
  1695.         EXAMPLE
  1696.      
  1697.         NOTES
  1698.          The longword doesn't need to be word aligned.
  1699.      
  1700.         BUGS
  1701.          The 68020++ version of amigancp.library requires the hardware
  1702.          to be able to do misaligned word accesses. Some early
  1703.          accelerator boards may have problems doing this.
  1704.      
  1705.         SEE ALSO
  1706.  
  1707. Error codes from NCP functions
  1708. ==============================
  1709.  
  1710. Several amigancp.library functions may return negative error
  1711. numbers.  Note that besides the errors internal to
  1712. amigancp.library, standard EPOC OS errors may be returned by some
  1713. functions.
  1714.  
  1715. NCPE_INUSE (-1)
  1716.      There is already a read/write request pending on the given channel.
  1717.  
  1718. NCPE_ABORTED (-2)
  1719.      The read/write request has been aborted by NCP_AbortXXX()
  1720.  
  1721. NCPE_OFFLINE (-3)
  1722.      There is no NCP connection.  This may denote that the remote NCP
  1723.      closed the connection.
  1724.  
  1725. NCPE_INACTIVE (-4)
  1726.      The channel is currently inactive.  Most likely it has been closed
  1727.      by the remote process, or the NCP connection is currently dropped
  1728.      due to serial link failure.
  1729.  
  1730. NCPE_NOTFOUND (-5)
  1731.      You attempted to open an active channel and the remote process
  1732.      didn't exist.
  1733.  
  1734. NCPE_RECONNECTED (-6)
  1735.      This is not really an error.  Queued read requests will be
  1736.      terminated with this error value if the NCP connection has been
  1737.      succesfully reconnected.
  1738.  
  1739. NCPE_NEWUSER (-7)
  1740.      This is not really an error.  It may come up if the remote client
  1741.      of a passive channel changed.
  1742.  
  1743. Index
  1744. *****
  1745.  
  1746.  
  1747.  
  1748.  NCP.config                             Using AmigaNCP
  1749.  AmigaNCP File Server                   File Server
  1750.  AmigaNCP File System                   File System
  1751.  amigancp.library calls                 API
  1752.  amigancp.library functions             API
  1753.  API                                    API
  1754.  error codes                            Errors
  1755.  File Server options                    File Server
  1756.  File System Options                    File System
  1757.  function calls                         API
  1758.  Installation                           Using AmigaNCP
  1759.  Installing AmigaNCP                    Using AmigaNCP
  1760.  Introduction                           Introduction
  1761.  Monitor                                AmigaNCP-Monitor
  1762.  NCP errors                             Errors
  1763.  NCP-Monitor                            AmigaNCP-Monitor
  1764.  NCP_AbortRead                          NCP_AbortRead
  1765.  NCP_AbortWrite                         NCP_AbortWrite
  1766.  NCP_BeginRead                          NCP_BeginRead
  1767.  NCP_BeginWrite                         NCP_BeginWrite
  1768.  NCP_CheckRead                          NCP_CheckRead
  1769.  NCP_CheckWrite                         NCP_CheckWrite
  1770.  NCP_clnl                               NCP_clnl
  1771.  NCP_CloseChannel                       NCP_CloseChannel
  1772.  NCP_Fault                              NCP_Fault
  1773.  NCP_ibm2iso                            NCP_ibm2iso
  1774.  NCP_ILONG                              NCP_ILONG
  1775.  NCP_ILONGP                             NCP_ILONGP
  1776.  NCP_ILONGPI                            NCP_ILONGPI
  1777.  NCP_iso2ibm                            NCP_iso2ibm
  1778.  NCP_IWORD                              NCP_IWORD
  1779.  NCP_IWORDP                             NCP_IWORDP
  1780.  NCP_IWORDPI                            NCP_IWORDPI
  1781.  NCP_LinkRemoteRun                      NCP_LinkRemoteRun
  1782.  NCP_OpenChannel                        NCP_OpenChannel
  1783.  NCP_Read                               NCP_Read
  1784.  NCP_ReadSig                            NCP_ReadSig
  1785.  NCP_WaitRead                           NCP_WaitRead
  1786.  NCP_WaitWrite                          NCP_WaitWrite
  1787.  NCP_Write                              NCP_Write
  1788.  NCP_WriteSig                           NCP_WriteSig
  1789.  Network Monitor                        AmigaNCP-Monitor
  1790.  Options, File Server                   File Server
  1791.  Options, File System                   File System
  1792.  Other Tools                            Other Tools
  1793.  Parts                                  Introduction
  1794.  Remote File Server                     File Server
  1795.  Remote File System                     File System
  1796.  S3PrintServer                          S3PrintServer
  1797.  S3Run                                  S3Run
  1798.  serial configuration                   Using AmigaNCP
  1799.  serial.device, configuration of        Using AmigaNCP
  1800.  
  1801.